//
//  TestingClass.m
//  GroupTutorial
//
//  Created by Sherif Nosseir on 11-10-25.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import "TestingClass.h"

@implementation TestingClass

@synthesize rb, bb, blackb;
@synthesize lab;
@synthesize tf;

-(IBAction)tapBackground:(id)sender{
    NSString *h = @"hello";
    NSString *hello = [[NSString alloc]initWithFormat:@"%@ back to you!", h];
    
    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Message" message:hello delegate:nil cancelButtonTitle:@"Done" otherButtonTitles: nil];
    [alert show];
    
    [hello release];
    [alert release];
    
    [tf resignFirstResponder];
}

-(IBAction)doneButton:(id)sender{
    [sender resignFirstResponder];
}

-(IBAction)redBackground:(id)sender{
    lab.text = @"Red Background";
    self.view.backgroundColor = [UIColor redColor];
}

-(IBAction)blueBackground:(id)sender{
        lab.text = @"Blue Background";
    self.view.backgroundColor = [UIColor blueColor];    
}

-(IBAction)blackBackground:(id)sender{
        lab.text = @"Black Background";
    self.view.backgroundColor = [UIColor blackColor];
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

-(void)dealloc{
    [rb release];
    [bb release];
    [blackb release];
    [lab release];
    [tf release];
    
    [super dealloc];
}

@end
